package com.unionftech.common.common.bean

import android.os.Parcel
import android.os.Parcelable

data class AppVersionInfo(
    val downloadUrl: String,
    val forceUpdateRemark: String,
    val id: Int,
    val isForceUpdate: Int,
    val osType: Int,
    val packageName: String,
    val packageSize: Double,
    val remark: String,
    val versionCode: String
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readString().toString(),
        parcel.readDouble(),
        parcel.readString().toString(),
        parcel.readString().toString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(downloadUrl)
        parcel.writeString(forceUpdateRemark)
        parcel.writeInt(id)
        parcel.writeInt(isForceUpdate)
        parcel.writeInt(osType)
        parcel.writeString(packageName)
        parcel.writeDouble(packageSize)
        parcel.writeString(remark)
        parcel.writeString(versionCode)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<AppVersionInfo> {
        override fun createFromParcel(parcel: Parcel): AppVersionInfo {
            return AppVersionInfo(parcel)
        }

        override fun newArray(size: Int): Array<AppVersionInfo?> {
            return arrayOfNulls(size)
        }
    }
}